#include <stdio.h>

void swap(int *num1, int *num2);
int main(int argc, char const *argv[])
{
    int a = 10, b = 20;
    //*p=&a等价于int *p; p=&a;
    swap(&a, &b);

    printf("a = %d\n", a);
    printf("b = %d", b);
    return 0;
}

void swap(int *num1, int *num2)
{
    int temp;
    temp = *num1;
    *num1 = *num2;
    *num2 = temp;
}